<template>
  <div class="shop-info">
    <div class="shop-top">
      <img :src="shopinfo.logo" alt="" />
      <span>{{ shopinfo.name }}</span>
    </div>

    <div class="shop-middle">
      <div class="shop-middle-left shop-middle-item">
        <div class="info-sells">
          <div class="sells-count">{{ shopinfo.sells }}</div>
          <div class="sells-text">总销量</div>
        </div>

        <div class="info-goods">
          <div class="goods-count">{{ shopinfo.goodsCount }}</div>
          <div class="goods-text">全部宝贝</div>
        </div>
      </div>

      <div class="shop-middle-right shop-middle-item">
        <table>
          <tr v-for="(item, index) in shopinfo.score" :key="index">
            <td>{{ item.name }}</td>
            <td class="scpre" :class="{ 'score-better': item.isBetter }">
              <span>{{ item.score }}</span>
            </td>
            <td class="better" :class="{ 'better-more': item.isBetter }">
              <span>{{ item.isBetter ? "高" : "低" }}</span>
            </td>
          </tr>
        </table>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "DetailShopInfo",
  props: {
    shopinfo: {
      type: Object,
      default() {
        return {};
      },
    },
  },
};
</script>

<style scoped>
.shop-info {
  padding: 25px 8px;
  border-bottom: 5px solid #f2f5f8;
}
.shop-top {
  line-height: 45px;
  display: flex;
  align-items: center;
  margin-top: 5px;
}
.shop-top img {
  height: 45px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 1);
}
.shop-top span {
  margin-left: 5px;
}
.shop-middle {
  margin-top: 15px;
  display: flex;
  align-items: center;
}
.shop-middle-left{
  display: flex;
}
.info-sells, .info-goods{
  flex: 1;
}
.shop-middle-item {
  flex: 1;
}
.sells-count, .goods-count{
  font-size: 18px;
}
.sells-text, .goods-text{
  margin-top: 10px;
  font-size: 12px;
}
.shop-middle-right{
  font-size: 13px;
  color: #333;
}
.shop-middle-right table{
  width: 120px;
  margin-left: 30px;
}
.shop-middle-right table td{
  padding: 5px 0;
}
.shop-middle-right .score-better{
  color: #f13e3a;
}
.shop-middle-right .better span {
  background-color: #5ea723;
  color: #fff;
  text-align: center;
}
.shop-middle-right .better-more span{
  background-color: #f13e3a;
}
</style>